<?
$kleur = mysql_fetch_assoc(mysql_query("SELECT * FROM color WHERE active = 1"));
$huidigeKleur = $kleur['color'];	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?=$this->title?></title>
<link rel="stylesheet"
	href="<?=$this->templateUrl()?>/css/front/style.css" type="text/css" />
<link rel="stylesheet"
	href="<?=$this->templateUrl()?>/css/front/style<?=$huidigeKleur?>.css" />
<link rel="stylesheet"
	href="<?=$this->templateUrl()?>/css/front/jquery-ui.css"
	type="text/css" />
	<link rel="icon" 
      type="image/png" 
      href="<?=$this->templateUrl()?>/images/front/favicon.ico">
	<link href='http://fonts.googleapis.com/css?family=Ubuntu'
	rel='stylesheet' type='text/css'>
	<?=$this->includeLibs()?>
</head>

<body>
	<div id="wrapper">
		<div id="header">
			<img alt="" border="0"
				src="<?=$this->templateUrl()?>/images/front/Banner.png"
				usemap="#bannermap" />
			<map name="bannermap">
				<area shape="poly" coords="0,154,254,154,160,216,0,216" alt="banner"
					href="http://www.pkn.nl" />
				<area shape="poly" coords="0,0,900,0,900,216,160,216,254,154,0,154"
					alt="banner" href="http://www.pgschagen.nl" />
			</map>
		</div>
		<div id="menu">
			<!-- menu -->
			<div id="parentpages_wrap">
			<?php 
			$query = mysql_query("SELECT * FROM page WHERE parent_id = 0 ORDER BY `id` ASC");
			while($data = mysql_fetch_object($query)){
				echo '<a href="'.$this->baseUrl().'/'.strtolower($data->url).'">'.$data->name.'</a> | ';
			}
			echo '<a href="'.$this->baseUrl().'/reserveringsmodule">Ruimte reserveren</a><br>';
			?>
			</div>
			<div id="subpages_wrap">
			<?php

			if(isset($this->page_content)){
			$menuquery = mysql_query("SELECT * FROM page WHERE parent_id = '".$this->page_content->id."' AND `protected` = 0");

				while($data = mysql_fetch_object($menuquery)){
					echo '<a href="'.$this->selfURL().'/'.strtolower($data->url).'">'.$data->name.'</a> | ';
				}
				
				if(sizeof($this->parent_page) == 5){
					$submenu = mysql_fetch_assoc(mysql_query("SELECT id FROM page WHERE protected ='0' AND name = '".$this->parent_page[3]."' "));
					$menuContent = mysql_query("SELECT * FROM page WHERE protected='0' AND parent_id = '".$submenu['id']."'");
					
					while($data =  mysql_fetch_object($menuContent)){
						echo '<a href="'.strtolower($data->url).'">'.$data->name.'</a> | ';
					}
					
				}
			}
			?>
	
		</div>
	</div>
	<div id="content" style="padding:10px;">
	<?=$this->loadView()?>
	</div>
	<div id="footer">
		&copy; Protestantse Gemeente Schagen | <a
			href="<?=$this->baseUrl()?>/login?logout=false" alt="" />CMS</a>
	</div>
	</div>
</body>
</html>
